# add any required libraries
#set (LINK_LIBRARIES)
#LINK_DIRECTORIES( "" )
#set (LINK_LIBRARIES "")

if (ANDROID)
set (LINK_LIBRARIES "${LINK_LIBRARIES} -llog")
endif(ANDROID)

if (${PTHREAD_FOUND})
   set (LINK_LIBRARIES ${PTHREAD_LIBRARIES})
   LINK_DIRECTORIES(${GEN_THREAD_LIB_DIR})
   INCLUDE_DIRECTORIES(${PTHREAD_INCLUDE_DIR})
   list (APPEND DEPLIBS "-L${GEN_THREAD_LIB_DIR}" "${GEN_THREAD_LIB_DIR}/libgen_thread.la")
endif()

add_library( dashmem MODULE dashmem.c )
add_library( dashmem-static STATIC dashmem.c )

SET_TARGET_PROPERTIES(dashmem-static PROPERTIES OUTPUT_NAME "dashmem")
SET_TARGET_PROPERTIES(dashmem-static PROPERTIES PREFIX "lib")
SET_TARGET_PROPERTIES(dashmem PROPERTIES LT_SHOULDNOTLINK "no")
SET_TARGET_PROPERTIES(dashmem PROPERTIES LT_DEPENDENCY_LIBS "${DEP_STRING}")

target_link_libraries (dashmem-static ${LINK_LIBARIES})
target_link_libraries (dashmem ${LINK_LIBRARIES})

install (TARGETS dashmem dashmem-static
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
)
